# -*- coding: utf-8 -*-
# @Time    : 2024/8/30 11:30
# @Author  : qd
# @Email   : 1518603573@qq.com
# @File    : product_add_page.py
# @Software: PyCharm
from pages.base_page import BasePage
from selenium import webdriver
from selenium.webdriver.common.by import By

"""产品添加页面"""
class ProductAddPage(BasePage):
    url="/crm/index.php?m=product&a=add"
    """产品名称定位器"""
    product_name_locator = (By.ID, "name")
    """开发团队定位器"""
    development_team_locator = (By.ID, "development_team")
    """图片定位器"""
    pic_locator = (By.ID, "main_pic")
    """添加按钮定位器"""
    product_add_btn_locator = (By.NAME, "submit")

    """输入产品名称"""
    def input_product_name(self,product_name):
        self.driver.find_element(*self.product_name_locator).send_keys(product_name)

    """输入开发团队"""
    def input_development_team(self,development_team):
        self.driver.find_element(*self.development_team_locator).send_keys(development_team)

    """添加图片"""
    def input_product_pic(self, product_pic):
        self.driver.find_element(*self.development_team_locator).send_keys(product_pic)

    """点击保存按钮"""
    def click_product_add_btn(self):
        self.driver.find_element(*self.product_add_btn_locator).click()


